import httpInstance from "@/utils/http";
// 获取轮播图数据
function getSlideData(params = {}) {
  // 广告区域展示位置（投放位置 投放位置，1为首页，2为分类商品页） 默认是1
  const { distributionSite = '1' } = params
  return httpInstance({
    url: '/home/banner',
    params: {
      distributionSite
    }
  })
}
/** @description: 获取新鲜好物
  * @param {*}
  * @return { *}
*/
function findNewAPI() {
  return httpInstance({
    url: '/home/new'
  })
}

// 获取 人气推荐
function HotAPI() {
  return httpInstance({
    url: '/home/hot'
  })
}

/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
  return httpInstance({
    url: '/home/goods'
  })
}

export { getSlideData, findNewAPI, HotAPI }
